// ==================== 通用类型定义 ====================

/** 分页结果 */
export interface PageResult<T> {
  list: T[];
  total: number;
}

/** Action 执行结果 */
export interface ActionResult<T = any> {
  success: boolean;
  msg: string;
  data?: T;
  code?: string;
}

/** 分页查询参数 */
export interface PageQuery {
  pageNo?: number;
  pageSize?: number;
}

// ==================== 婚纱相关类型 ====================

/** 婚纱状态枚举 */
export enum DressStatus {
  AVAILABLE = 'AVAILABLE',    // 可用
  RESERVED = 'RESERVED',       // 已预约
  RENTED = 'RENTED',          // 已租出
  MAINTENANCE = 'MAINTENANCE', // 维护中
  RETIRED = 'RETIRED',        // 已下架
}

/** 婚纱类别枚举 */
export enum DressCategory {
  WEDDING = 'WEDDING',        // 婚纱
  EVENING = 'EVENING',        // 晚礼服
  CUSTOM = 'CUSTOM',          // 定制款
  BRIDESMAID = 'BRIDESMAID',  // 伴娘服
}

/** 婚纱礼服 */
export interface WeddingDress {
  id: number;
  dressCode: string;          // 婚纱编号
  dressName: string;          // 婚纱名称
  category: DressCategory;    // 类别
  brand: string;              // 品牌
  size: string;               // 尺码
  color: string;              // 颜色
  style: string;              // 风格
  rentalPrice: number;        // 租赁价格
  depositPrice: number;       // 押金
  inventoryCount: number;     // 库存数量
  status: DressStatus;        // 状态
  images: string[];           // 图片列表
  description?: string;       // 描述
  createTime: string;
  updateTime?: string;
}

/** 婚纱查询参数 */
export interface DressQuery extends PageQuery {
  dressCode?: string;
  dressName?: string;
  category?: DressCategory;
  status?: DressStatus;
  minPrice?: number;
  maxPrice?: number;
}

/** 婚纱租赁订单 */
export interface DressRentalOrder {
  id: number;
  orderId: string;            // 订单ID
  dressCode: string;          // 婚纱编号
  customerId: string;         // 客户ID
  customerName: string;       // 客户姓名
  rentStartDate: string;      // 租赁开始日期
  rentEndDate: string;        // 租赁结束日期
  rentDays: number;           // 租赁天数
  totalAmount: number;        // 总金额
  paidAmount: number;         // 已付金额
  depositAmount: number;      // 押金
  status: string;             // 订单状态
  createTime: string;
}

// ==================== 化妆师相关类型 ====================

/** 化妆师状态枚举 */
export enum ArtistStatus {
  AVAILABLE = 'AVAILABLE',    // 可预约
  BUSY = 'BUSY',             // 服务中
  BOOKED = 'BOOKED',         // 已预约
  OFF_DUTY = 'OFF_DUTY',     // 休息中
}

/** 服务等级枚举 */
export enum ServiceLevel {
  JUNIOR = 'JUNIOR',         // 初级
  SENIOR = 'SENIOR',         // 高级
  MASTER = 'MASTER',         // 首席
  CHIEF = 'CHIEF',           // 总监
}

/** 化妆师 */
export interface MakeupArtist {
  id: number;
  artistCode: string;         // 化妆师编号
  artistName: string;         // 化妆师姓名
  gender: string;             // 性别
  phone: string;              // 电话
  serviceLevel: ServiceLevel; // 服务等级
  servicePrice: number;       // 服务价格
  workYears: number;          // 从业年限
  rating: number;             // 评分
  specialties: string[];      // 擅长领域
  status: ArtistStatus;       // 状态
  avatar?: string;            // 头像
  introduction?: string;      // 简介
  workSamples: string[];      // 作品集
  createTime: string;
  updateTime?: string;
}

/** 化妆师查询参数 */
export interface ArtistQuery extends PageQuery {
  artistCode?: string;
  artistName?: string;
  serviceLevel?: ServiceLevel;
  status?: ArtistStatus;
  minRating?: number;
}

/** 化妆服务订单 */
export interface MakeupServiceOrder {
  id: number;
  orderId: string;
  artistCode: string;
  artistName: string;
  customerId: string;
  customerName: string;
  serviceTime: string;        // 服务时间
  serviceAddress: string;     // 服务地址
  serviceAmount: number;      // 服务金额
  paidAmount: number;         // 已付金额
  status: string;             // 订单状态
  rating?: number;            // 评分
  comment?: string;           // 评价
  createTime: string;
}

// ==================== 摄影师相关类型 ====================

/** 摄影师 */
export interface Photographer {
  id: number;
  photographerCode: string;   // 摄影师编号
  photographerName: string;   // 摄影师姓名
  gender: string;
  phone: string;
  serviceLevel: ServiceLevel;
  servicePrice: number;
  workYears: number;
  rating: number;
  specialtyStyles: string[];  // 擅长风格
  equipment: string[];        // 设备信息
  status: ArtistStatus;
  avatar?: string;
  introduction?: string;
  portfolio: string[];        // 作品集
  createTime: string;
  updateTime?: string;
}

/** 摄影师查询参数 */
export interface PhotographerQuery extends PageQuery {
  photographerCode?: string;
  photographerName?: string;
  serviceLevel?: ServiceLevel;
  status?: ArtistStatus;
  minRating?: number;
}

/** 摄影订单 */
export interface PhotographyOrder {
  id: number;
  orderId: string;
  photographerCode: string;
  photographerName: string;
  customerId: string;
  customerName: string;
  shootingTime: string;       // 拍摄时间
  shootingLocation: string;   // 拍摄地点
  photoCount: number;         // 拍摄数量
  retouchCount: number;       // 精修数量
  serviceAmount: number;
  paidAmount: number;
  status: string;
  deliveryTime?: string;      // 交付时间
  createTime: string;
}

// ==================== 婚礼订单相关类型 ====================

/** 订单状态枚举 */
export enum OrderStatus {
  DRAFT = 'DRAFT',           // 草稿
  CONFIRMED = 'CONFIRMED',   // 已确认
  PAID = 'PAID',             // 已支付
  IN_PROGRESS = 'IN_PROGRESS', // 进行中
  COMPLETED = 'COMPLETED',   // 已完成
  CANCELLED = 'CANCELLED',   // 已取消
}

/** 服务类型枚举 */
export enum ServiceType {
  DRESS = 'DRESS',           // 婚纱
  MAKEUP = 'MAKEUP',         // 化妆
  PHOTOGRAPHY = 'PHOTOGRAPHY', // 摄影
  PACKAGE = 'PACKAGE',       // 套餐
}

/** 服务项 */
export interface ServiceItem {
  id?: number;
  itemId: string;
  serviceType: ServiceType;
  resourceCode: string;
  resourceName: string;
  price: number;
  quantity: number;
  subtotal: number;
  remarks?: string;
}

/** 婚礼订单 */
export interface WeddingOrder {
  id?: number;
  orderId: string;
  customerId: string;
  customerName: string;
  customerPhone: string;
  weddingDate: string;        // 婚期
  totalAmount: number;        // 总金额
  paidAmount: number;         // 已付金额
  discountAmount: number;     // 优惠金额
  status: OrderStatus;
  serviceItems: ServiceItem[];
  remarks?: string;
  createTime: string;
  updateTime?: string;
}

/** 订单查询参数 */
export interface OrderQuery extends PageQuery {
  orderId?: string;
  customerName?: string;
  status?: OrderStatus;
  weddingDateStart?: string;
  weddingDateEnd?: string;
}

/** 订单时间轴项 */
export interface OrderTimelineItem {
  id: number;
  orderId: string;
  action: string;             // 操作
  description: string;        // 描述
  operator: string;           // 操作人
  operateTime: string;        // 操作时间
}

// ==================== 统计相关类型 ====================

/** 仪表板统计数据 */
export interface DashboardStatistics {
  monthlyBookings: number;     // 本月预约数
  dressUtilization: number;    // 婚纱利用率
  monthlyRevenue: number;      // 本月营收
  customerSatisfaction: number; // 客户满意度
  totalDresses: number;        // 婚纱总数
  totalArtists: number;        // 化妆师总数
  totalPhotographers: number;  // 摄影师总数
  totalOrders: number;         // 订单总数
}

/** 预约趋势数据 */
export interface BookingTrend {
  date: string;
  dressBookings: number;
  makeupBookings: number;
  photographyBookings: number;
}

/** 服务分布数据 */
export interface ServiceDistribution {
  serviceType: string;
  count: number;
  percentage: number;
  revenue: number;
}

/** 资源利用率数据 */
export interface ResourceUtilization {
  resourceType: string;
  total: number;
  inUse: number;
  utilization: number;
}

/** 待办事项 */
export interface TodoItem {
  id: number;
  title: string;
  description: string;
  type: string;               // 类型：预约、支付、服务等
  priority: 'high' | 'medium' | 'low';
  deadline?: string;
  status: 'pending' | 'completed';
  createTime: string;
}

// ==================== 客户相关类型 ====================

/** 客户信息 */
export interface Customer {
  id: number;
  customerId: string;
  customerName: string;
  phone: string;
  email?: string;
  weddingDate?: string;
  partnerName?: string;       // 伴侣姓名
  address?: string;
  remarks?: string;
  totalOrders: number;        // 订单总数
  totalSpent: number;         // 总消费
  createTime: string;
}

/** 客户查询参数 */
export interface CustomerQuery extends PageQuery {
  customerName?: string;
  phone?: string;
  weddingDateStart?: string;
  weddingDateEnd?: string;
}

// ==================== 预约相关类型 ====================

/** 预约请求参数 */
export interface ReserveDressParams {
  dressCode: string;
  customerId: string;
  rentStartDate: string;
  rentDays: number;
}

export interface BookArtistParams {
  artistCode: string;
  customerId: string;
  serviceTime: string;
  serviceAddress: string;
}

export interface BookPhotographerParams {
  photographerCode: string;
  customerId: string;
  shootingTime: string;
  shootingLocation: string;
  photoCount: number;
  retouchCount: number;
}

/** 档期检查结果 */
export interface ScheduleCheckResult {
  available: boolean;
  conflictDates?: string[];
  message: string;
}

/** 库存检查结果 */
export interface InventoryCheckResult {
  available: boolean;
  availableCount: number;
  message: string;
}

